# define M_PI 3.14159265358979323846
#endif
-#ifndef FALSE
-# define FALSE false
-#endif
-
-#ifndef TRUE
-# define TRUE true
-#endif
-
-#define FEET_TO_METERS(feetsies) ((feetsies) * 0.3048)
-#define METERS_TO_FEET(meetsies) ((meetsies) * 3.2808399)
+constexpr double FEET_TO_METERS(double feetsies) { return (feetsies) * 0.3048; };
+constexpr double METERS_TO_FEET(double meetsies) { return (meetsies) * 3.2808399; };
-#define NMILES_TO_METERS(a) ((a) * 1852.0) /* nautical miles */
-#define METERS_TO_NMILES(a) ((a) / 1852.0)
+constexpr double NMILES_TO_METERS(double a) { return a * 1852.0;}; /* nautical miles */
+constexpr double METERS_TO_NMILES(double a) { return a / 1852.0;};
-#define MILES_TO_METERS(a) ((a) * 1609.344)
-#define METERS_TO_MILES(a) ((a) / 1609.344)
-#define FATHOMS_TO_METERS(a) ((a) * 1.8288)
+constexpr double MILES_TO_METERS(double a) { return (a) * 1609.344;};
+constexpr double METERS_TO_MILES(double a) { return (a) / 1609.344;};
+constexpr double FATHOMS_TO_METERS(double a) { return (a) * 1.8288;};
-#define CELSIUS_TO_FAHRENHEIT(a) (((a) * 1.8) + 32)
-#define FAHRENHEIT_TO_CELSIUS(a) (((a) - 32) / 1.8)
+constexpr double CELSIUS_TO_FAHRENHEIT(double a) { return (((a) * 1.8) + 32);};
+constexpr double FAHRENHEIT_TO_CELSIUS(double a) { return (((a) - 32) / 1.8);};
-#define SECONDS_PER_HOUR (60L*60)
-#define SECONDS_PER_DAY (24L*60*60)
+constexpr double SECONDS_PER_HOUR = 60L * 60;
+constexpr double SECONDS_PER_DAY = 24L * 60 * 60;
/* meters/second to kilometers/hour */
-#define MPS_TO_KPH(a) ((a)*SECONDS_PER_HOUR/1000.0)
+constexpr double MPS_TO_KPH(double a) { return (a)*SECONDS_PER_HOUR/1000.0;};
/* meters/second to miles/hour */
-#define MPS_TO_MPH(a) (METERS_TO_MILES(a) * SECONDS_PER_HOUR)
+constexpr double MPS_TO_MPH(double a) { return METERS_TO_MILES(a) * SECONDS_PER_HOUR;};
/* meters/second to knots */
-#define MPS_TO_KNOTS(a) (MPS_TO_KPH((a)/1.852))
+constexpr double MPS_TO_KNOTS(double a) { return MPS_TO_KPH((a)/1.852);};
/* kilometers/hour to meters/second */
-#define KPH_TO_MPS(a) ((a)*1000.0/SECONDS_PER_HOUR)
+constexpr double KPH_TO_MPS(double a) { return a * 1000.0/SECONDS_PER_HOUR;};
/* miles/hour to meters/second */
#define MPH_TO_MPS(a) (MILES_TO_METERS(a) / SECONDS_PER_HOUR)
/* knots to meters/second */
-#define KNOTS_TO_MPS(a) (KPH_TO_MPS((a)*1.852))
+constexpr double KNOTS_TO_MPS(double a) {return KPH_TO_MPS(a) * 1.852; };
#define MILLI_TO_MICRO(t) ((t) * 1000) /* Milliseconds to Microseconds */
#define MICRO_TO_MILLI(t) ((t) / 1000) /* Microseconds to Milliseconds*/
GetCommState(h->comport, &tio);
tio.BaudRate = mkspeed(speed);
- tio.fBinary = TRUE;
- tio.fParity = TRUE;
- tio.fOutxCtsFlow = FALSE;
- tio.fOutxDsrFlow = FALSE;
+ tio.fBinary = true;
+ tio.fParity = true;
+ tio.fOutxCtsFlow = false;
+ tio.fOutxDsrFlow = false;
tio.fDtrControl = DTR_CONTROL_ENABLE;
- tio.fDsrSensitivity = FALSE;
- tio.fTXContinueOnXoff = TRUE;
- tio.fOutX = FALSE;
- tio.fInX = FALSE;
- tio.fErrorChar = FALSE;
- tio.fNull = FALSE;
+ tio.fDsrSensitivity = false;
+ tio.fTXContinueOnXoff = true;
+ tio.fOutX = false;
+ tio.fInX = false;
+ tio.fErrorChar = false;
+ tio.fNull = false;
tio.fRtsControl = RTS_CONTROL_ENABLE;
- tio.fAbortOnError = FALSE;
+ tio.fAbortOnError = false;
tio.ByteSize = bits;
tio.Parity = parity == 0 ? NOPARITY :
(parity == 1 ? ODDPARITY : EVENPARITY);
}
track_add_head(trk_head);
- auto vecs = args.simplified().split(' ');
+ const auto vecs = args.simplified().split(' ');
for(const auto& vec : vecs) {
- QStringList coords = vec.split(',');
+ const QStringList coords = vec.split(',');
auto csize = coords.size();
auto trkpt = new Waypoint;
<ClInclude Include="swapdata.h" />\r
<ClInclude Include="trackfilter.h" />\r
<ClInclude Include="transform.h" />\r
+ <ClInclude Include="units.h" />\r
<ClInclude Include="zlib\trees.h" />\r
<ClInclude Include="src\core\usasciicodec.h" />\r
<ClInclude Include="validate.h" />\r
</ItemGroup>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<ImportGroup Label="ExtensionTargets" />\r
-</Project>
\ No newline at end of file
+</Project>\r